/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.demoapp.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import net.ibizsys.paas.appmodel.AppModelGlobal;
import net.ibizsys.paas.appmodel.IApplicationModel;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.sysmodel.ISystemModel;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.controller.ViewControllerGlobal;
import net.ibizsys.paas.ctrlmodel.ICtrlModel;
import net.ibizsys.paas.ctrlhandler.ICtrlHandler;


import com.sa.ibiz.demo.srv.MyTestSysSysModel;
import com.sa.ibiz.demo.demoapp.DemoAppAppModel;


/**
 * 视图[IBZ5CUSTOMERMG2EditView2]控制类基类
 *
 * !! 不要对此代码进行修改
 */
@Controller
@RequestMapping(value = "/DemoApp/Demo/IBZ5CUSTOMERMG2EditView2.do")
public class IBZ5CUSTOMERMG2EditView2Controller extends net.ibizsys.paas.controller.EditView2ControllerBase {
    public IBZ5CUSTOMERMG2EditView2Controller() throws Exception {
        super();
        this.setId("ac8aa990a07ccafa1ef6829d24108fb1");
        this.setCaption("客户管理（虚拟实体）");
        this.setTitle("客户管理（虚拟实体）编辑视图");
        this.setCapLanResTag("DE.LNAME.IBZ5CUSTOMERMG2");
        this.setTitleLanResTag("PAGE.TITLE.IBZ5CUSTOMERMG2.EDITVIEW2");
        this.setAccessUserMode(2);
        //
        this.setAttribute("UI.CTRL.FORM","TRUE");
        //显示数据信息栏
        this.setAttribute("UI.SHOWDATAINFOBAR","TRUE");
        //
        this.setAttribute("UI.CTRL.DRBAR","TRUE");
        //
        this.setAttribute("UI.CTRL.TOOLBAR","TRUE");

        ViewControllerGlobal.registerViewController("/DemoApp/Demo/IBZ5CUSTOMERMG2EditView2.do",this);
        ViewControllerGlobal.registerViewController("com.sa.ibiz.demo.demoapp.demo.controller.IBZ5CUSTOMERMG2EditView2Controller",this);
    }


    @Override
    protected void prepareViewParam() throws Exception {
        super.prepareViewParam();


    }

    private MyTestSysSysModel myTestSysSysModel;

    public  MyTestSysSysModel getMyTestSysSysModel() {
        if(this.myTestSysSysModel==null) {
            try {
                this.myTestSysSysModel = (MyTestSysSysModel)SysModelGlobal.getSystem("com.sa.ibiz.demo.srv.MyTestSysSysModel");
            } catch(Exception ex) {
            }
        }
        return this.myTestSysSysModel;
    }

    @Override
    public  ISystemModel getSystemModel() {
        return this.getMyTestSysSysModel();
    }


    private DemoAppAppModel demoAppAppModel;
    public  DemoAppAppModel getDemoAppAppModel() {
        if(this.demoAppAppModel==null) {
            try {
                this.demoAppAppModel = (DemoAppAppModel)AppModelGlobal.getApplication("com.sa.ibiz.demo.demoapp.DemoAppAppModel");
            } catch(Exception ex) {
            }
        }
        return this.demoAppAppModel;
    }

    @Override
    public  IApplicationModel  getAppModel() {
        return this.getDemoAppAppModel();
    }





    private com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DEModel iBZ5CUSTOMERMG2DEModel;

    public  com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DEModel getIBZ5CUSTOMERMG2DEModel() {
        if(this.iBZ5CUSTOMERMG2DEModel==null) {
            try {
                this.iBZ5CUSTOMERMG2DEModel = (com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DEModel)DEModelGlobal.getDEModel("com.sa.ibiz.demo.srv.demo.demodel.IBZ5CUSTOMERMG2DEModel");
            } catch(Exception ex) {
            }
        }
        return this.iBZ5CUSTOMERMG2DEModel;
    }

    public  IDataEntityModel getDEModel() {
        return this.getIBZ5CUSTOMERMG2DEModel();
    }

    public  com.sa.ibiz.demo.srv.demo.service.IBZ5CUSTOMERMG2Service getIBZ5CUSTOMERMG2Service() {
        try {
            return (com.sa.ibiz.demo.srv.demo.service.IBZ5CUSTOMERMG2Service)ServiceGlobal.getService("com.sa.ibiz.demo.srv.demo.service.IBZ5CUSTOMERMG2Service",this.getSessionFactory());
        } catch(Exception ex) {
            return null;
        }
    }

    /* (non-Javadoc)
    * @see net.ibizsys.paas.controller.IViewController#getService()
    */
    @Override
    public IService getService() {
        return getIBZ5CUSTOMERMG2Service();
    }





    /**
     * 准备部件模型
     * @throws Exception
     */
    @Override
    protected void prepareCtrlModels()throws Exception {
        //注册 form
        ICtrlModel editForm=(ICtrlModel)getMyTestSysSysModel().createObject("com.sa.ibiz.demo.demoapp.srv.demo.ctrlmodel.IBZ5CUSTOMERMG2MainEditFormModel");
        editForm.init(this);
        this.registerCtrlModel("form",editForm);
        //注册 drbar
        ICtrlModel drBar=(ICtrlModel)getMyTestSysSysModel().createObject("com.sa.ibiz.demo.demoapp.srv.demo.ctrlmodel.IBZ5CUSTOMERMG2DefaultDRBarModel");
        drBar.init(this);
        this.registerCtrlModel("drbar",drBar);
    }

    /**
     * 准备部件处理对象
     * @throws Exception
     */
    @Override
    protected void prepareCtrlHandlers()throws Exception {
        //注册 form
        ICtrlHandler editForm = (ICtrlHandler)getMyTestSysSysModel().createObject("com.sa.ibiz.demo.demoapp.demo.ctrlhandler.IBZ5CUSTOMERMG2EditView2EditFormHandler");
        editForm.init(this);
        this.registerCtrlHandler("form",editForm);
        //注册 drbar
        ICtrlHandler drBar = (ICtrlHandler)getMyTestSysSysModel().createObject("com.sa.ibiz.demo.demoapp.demo.ctrlhandler.IBZ5CUSTOMERMG2EditView2DRBarHandler");
        drBar.init(this);
        this.registerCtrlHandler("drbar",drBar);
    }


    /**
     * 注册界面行为
     * @throws Exception
     */
    @Override
    protected void prepareUIActions()throws Exception {

    }
}